<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('indexadmin/index')}">{:L('USER_INDEXADMIN_INDEX')}</a></li>
			<li class="active"><a>联系信息审核</a></li>
		</ul>
        <form class="form-horizontal js-ajax-form" action="{:U('indexadmin/contact_act',array('display'=>0))}" method="post">
			<fieldset>
				<div class="tabbable">
					<div class="tab-content">
						<php>$group=get_groups_admin_user();</php>
							<fieldset>
								<div class="control-group">
									<label class="control-label">姓名</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$user.name}</label>
										<input type="hidden" name="options[id]" value="{$user.id}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">手机号码</label>
									<div class="controls">
									<php>
										if($group==3 || $group==8 || $group==10 || $group==6 || $group==13){
											if($user['account_status']!=0){
												$mob=substr($user['mobile'],0,3).'****'.substr($user['mobile'],-4);
											}else{
												$mob=$user['mobile'];
											}
										}else{
											$mob=$user['mobile'];
										}
										</php>
										<label class="control-label" style="width:auto">{$mob}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">身份证</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$user.identity}</label>
									</div>
								</div>
								
								<div class="control-group">
									<label class="control-label">证件照</label>
									<div class="controls">
										<notempty name="user.url">
											<a href="javascript:parent.image_preview_dialog('{:sp_get_image_preview_url_qk($user['url'])}');">
												<i class="fa fa-photo fa-fw"></i>
											</a>
										</notempty>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">银行卡号</label>
									<div class="controls">
									<php>
										if($group==3 || $group==8 || $group==10 || $group==13 || $group==6){
											if($user['account_status']!=0){
												$mob=substr($user['silver_number'],0,3).'****'.substr($user['silver_number'],-4);
												$silver_card='********';
											}else{
												$mob=$user['silver_number'];
												$silver_card=$user['silver_card'];
											}
										}else{
											$mob=$user['silver_number'];
											$silver_card=$user['silver_card'];
										}
										</php>
									<label class="control-label" style="width:auto">{$silver_card}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">手机类型</label>
									<div class="controls">
									<label class="control-label" style="width:auto">{$user['photo_type']==1?'苹果':'安卓'}</label>
										
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">注册时间</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$user.crtime}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">学信网:</label>
									<div class="controls">
										<label class="control-label" style="width:auto">{$user.xuexin_name} &nbsp&nbsp&nbsp&nbsp密码&nbsp&nbsp{$user.xuexin_pass}</label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">qq</label>
									<div class="controls">
									<php>
										if($group==3 || $group==8 || $group==10 || $group==13 || $group==6){
											if($user['account_status']!=0){
												$weixin='*******';$qqs='*******';
											}else{
												$weixin=$user['email'];$qqs=$user['qq'];
											}
										}else{
											$weixin=$user['email'];$qqs=$user['qq'];
										}
										</php>
										<input type="text" name="options[qq]" value="{$qqs}">&nbsp&nbsp&nbsp&nbsp微信&nbsp&nbsp<input type="text" name="options[email]" value="{$weixin}"></span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">教育水平</label>
									<div class="controls">
										<select name="options[education]">
											<foreach name="education" item="vo">
											<php>$tpl_selected=$user['education']==$vo['education']?"selected":"";</php>
											<option value="{$vo.education}" {$tpl_selected}>{$vo.education}</option>
											</foreach>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">常住地址</label>
									<div class="controls">
										<textarea name="options[useraddr]" rows="4" cols="30">{$user.useraddr}</textarea>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">居住时长</label>
									<div class="controls">
										<select name="options[addr_time]">
											<php>$tpl_selected=$user['addr_time']=='三个月'?"selected":"";</php>
											<option {$tpl_selected} value="三个月">三个月</option>
											<php>$tpl_selected=$user['addr_time']=='六个月'?"selected":"";</php>
											<option {$tpl_selected} value="六个月">六个月</option>
											<php>$tpl_selected=$user['addr_time']=='一年'?"selected":"";</php>
											<option {$tpl_selected} value="一年">一年</option>
											<php>$tpl_selected=$user['addr_time']=='两年'?"selected":"";</php>
											<option {$tpl_selected} value="两年">两年</option>
											<php>$tpl_selected=$user['addr_time']=='两年以上'?"selected":"";</php>
											<option {$tpl_selected} value="两年以上">两年以上</option>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">父亲名字</label>
									<div class="controls">
										<input type="text" name="options[parent_f_n]" value="{$user.parent_f_n}"><span class="form-required">&nbsp&nbsp&nbsp&nbsp电话号码&nbsp&nbsp<input type="text" name="options[parent_f_t]" value="{$user.parent_f_t}"></span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">母亲名字</label>
									<div class="controls">
										<input type="text" name="options[parent_m_n]" value="{$user.parent_m_n}"><span class="form-required">&nbsp&nbsp&nbsp&nbsp电话号码&nbsp&nbsp<input type="text" name="options[parent_m_t]" value="{$user.parent_m_t}"></span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">同学A</label>
									<div class="controls">
										<input type="text" name="options[classm_a_n]" value="{$user.classm_a_n}"><span class="form-required">&nbsp&nbsp&nbsp&nbsp电话号码&nbsp&nbsp<input type="text" name="options[classm_a_t]" value="{$user.classm_a_t}"></span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">同学B</label>
									<div class="controls">
										<input type="text" name="options[classm_b_n]" value="{$user.classm_b_n}"><span class="form-required">&nbsp&nbsp&nbsp&nbsp电话号码&nbsp&nbsp<input type="text" name="options[classm_b_t]" value="{$user.classm_b_t}"></span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">是否禁止登录</label>
									<div class="controls">
										<select name="options[user_status]">
										<php>$html_cache_on_checked=$user_status=$user['user_status']=='0'?"selected":"";</php>
										<option value="0" {$html_cache_on_checked}>禁用</option>
										<php>$html_cache_on_checked=$user['user_status']=='1'?"selected":"";</php> 
										<option value="1" {$html_cache_on_checked}>正常</option>
									</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">芝麻分</label>
									<div class="controls">
										<input type="text" name="options[sesame_score]" value="{$user.sesame_score}" class="just_can_number">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">是否成人</label>
									<div class="controls">
										<!--<php>$html_cache_on_checked=($user['is_adult']=='1' || $user['is_adult']=='0' || $user['is_adult']=='')?"checked":"";</php>-->
										<php>$html_cache_on_checked=$user['is_adult']=='1'?"checked":"";</php>
										<label class="control-label" style="width:auto">成年 <input type="radio" name='options[is_adult]' {$html_cache_on_checked} value='1' class="utype"/>&nbsp;&nbsp;</label>
										<php>$html_cache_on_checked=$user['is_adult']=='2'?"checked":"";</php>
										<label class="control-label" style="width:auto">学生 <input type="radio" name='options[is_adult]' {$html_cache_on_checked} value='2' class="utype"/></label>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">审核备注</label>
									<div class="controls">
										<textarea name="options[messgae]" rows="4" cols="30"></textarea>
									</div>
								</div>
								<if condition="($log)">
								<div class="control-group">
									<label class="control-label">审核信息</label>
									<div class="controls">
									<label class="control-label" style="width:auto">
										<table border="1" style='text-align:center;width:800px' cellpadding='10px'>
											<tr>
												<th>审核类型</th>
												<th>审核时间</th>
												<th>审核人</th>
												<th>审核备注</th>
												<th>审核操作</th>
											</tr>
											<php>$stu_type=array('1'=>'借款中','2'=>'已还款','3'=>'逾期','4'=>'已到期','5'=>'审核中','6'=>'审核不通过','7'=>'驳回','8'=>'放款成功','9'=>'放款不成功','10'=>'待放款');
											$stu_ty=array('0'=>'用户审核','1'=>'订单审核','2'=>'用户信息审核','3'=>'续期审核','4'=>'逾期还款(本金)','5'=>'逾期还款','6'=>'订单审核');
											</php>
											<foreach name="log" item="vo">
												<tr>
													<td>{$stu_ty[$vo['types']]}</td>
													<td>{$vo.crtime}</td>
													<td>{$users[$vo['examine_id']]}</td>
													<td>{$vo.message}</td>
													<td>{$vo['status']?'审核成功':'审核失败'}</td>
												</tr>
											</foreach>
										</table>
									</label>
									</div>
								</div>
								</if>
								<div class="control-group">
									<label class="control-label">审核状态</label>
									<div class="controls">
										<label class="control-label" style="width:auto">审核通过 <input type="radio" name='options[display]' value='1' class="display"/>&nbsp;&nbsp;</label>
										
										<label class="control-label" style="width:auto">审核不通过 <input type="radio" name='options[display]' id='disp'  value='0' class="display"/>&nbsp;&nbsp;</label>
										<label class="control-label" style="width:auto">暂时不需要 <input type="radio" name='options[display]'  value='2' class="display"/></label>
									</div>
								</div>
								<div class="control-group" id='shen' style='display:none'>
									<label class="control-label">审核不通过原因</label>
									<div class="controls">
										<select name="options[user_status_shen]">
											<option value="1">通讯录低于40</option>
											<option value="2">手机卡实名不足半年</option>
											<option value="3">手机卡非本人实名</option>
											<option value="4">命中黑名单</option>
											<option value="5">芝麻分不符合（成人不能低于580）</option>
											<option value="6">年龄不符合（不能高于32岁）</option>
											<option value="7">地区不符合（学生：新疆西藏；成人：四川、新疆、西藏、内蒙古）</option>
											<option value="8">有当前逾期</option>
											<option value="9">资料不符合</option>
											<option value="10" selected>负债不符合</option>
										</select>
									</div>
								</div>
								<div class="control-group" id='he' style='display:none'>
									<label class="control-label">暂时不需要原因</label>
									<div class="controls">
										<select name="options[user_status_he]">
											<option value="11">未联系上客户</option>
											<option value="12">不愿意办理</option>
											<option value="13">客户不回复审核</option>
										</select>
									</div>
								</div>
							</fieldset>
					</div>
				</div>

				<div class="form-actions">
					<button class="btn btn-primary js-ajax-submit" type="submit" data-types='1' data-msg='审核确定?' data-subcheck="true">保存</button>
					<a class="btn btn-primary js-ajax-submit" href='javascript:history.back(-1)'>返回</a>
				</div>
			</fieldset>
		</form>
		
	</div>
	
</body>
<script type="text/javascript">
	var ajaxForm_list = $('form.js-ajax-form');
	if (ajaxForm_list.length) {
	    Wind.use('ajaxForm', 'artDialog', function () {
			
	        $('button.js-ajax-submit').bind('click', function (e) {

	            e.preventDefault();
	            /*var btn = $(this).find('button.js-ajax-submit'),
						form = $(this);*/
	            var btn = $(this),
	                form = btn.parents('form.js-ajax-form');
	            var is_adult_v = $(".utype:checked").val();
	            if('undefined'==typeof(is_adult_v)){
	                alert('请选择用户是否成人!');
		            return;
				}
				var is_adult_v = $(".display:checked").val();
	            if('undefined'==typeof(is_adult_v)){
	                alert('请选择审核是否通过!');
		            return;
				}
	            //批量操作 判断选项
	            if (btn.data('subcheck')) {
	                btn.parent().find('span').remove();
					var msg = btn.data('msg');
					if (msg) {
						art.dialog({
							id: 'warning',
							icon: 'warning',
							content: btn.data('msg'),
							cancelVal: "{:L('CLOSE')}",
							cancel: function () {
								
							},
							button :[ {
											name : "{:L('OK')}",
											callback:function(){
												ajaxSubmit(btn.data('types'));
											},
											focus : true
									} ]
						});
					} else {
						btn.data('subcheck', false);
						btn.click();
					}
	                return false;
	            }
	        });
	
	    });
	}
	function ajaxSubmit(type){
//	    	console.log(type);return;
			var btn = $('button.js-ajax-submit'),
			form = btn.parents('form.js-ajax-form');
			var true_url="{:U('indexadmin/contact_act')}";
			form.ajaxSubmit({
//	                url: type ? btn.data('action') : form.attr('action'),
	                url: true_url,
	                //按钮上是否自定义提交地址(多按钮情况)
	                dataType: 'json',
	                beforeSubmit: function (arr, $form, options) {
//						var tx=type ? '审核通过' : '审核不通过';
						var tx='操作';
	                    //按钮文案、状态修改
	                    btn.text(tx + '中...').attr('disabled', true).addClass('disabled');
	                },
	                success: function (data, statusText, xhr, $form) {
	                    //按钮文案、状态修改
	                    btn.removeClass('disabled').parent().find('span').remove();
	
	                    if (data.state === 'success') {
	                        $('<span class="tips_success">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('slow').delay(1000).fadeOut(function () {
	                            if (data.referer) {
	                                //返回带跳转地址
	                                if (window.parent.art) {
	                                    //iframe弹出页
	                                    window.parent.location.href = data.referer;
	                                } else {
	                                    window.location.href = data.referer;
	                                }
	                            } else {
	                                if (window.parent.art) {
	                                    reloadPage(window.parent);
	                                } else {
	                                    //刷新当前页
	                                    reloadPage(window);
	                                }
	                            }
	                        });
	                    } else if (data.state === 'fail') {
	                        $('<span class="tips_error">' + data.info + '</span>').appendTo(btn.parent()).fadeIn('fast');
	                        btn.removeProp('disabled').removeClass('disabled');
	                    }
	                }
	            });
	}
	</script>
<script>
    $(function(){
        $('.just_can_number').keyup(function(){
            var obj = this;
            obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
            obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
            obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
            obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
        });
		$('.display:radio').click(function () { 
			var is_adult_v = $(".display:checked").val();
			if(is_adult_v==1){
				$('#shen').hide();
				$('#he').hide();
			}else if(is_adult_v==2){
				$('#shen').hide();
				$('#he').show();
			}else{
				$('#shen').show();
				$('#he').hide();
			}
		});
    });
</script>
</html>